package com.designPattern.facade;

/**
 * @author mxs
 */
public class HomeController {
    private Light light;
    private Popcorn popcorn;
    private TVPlayer tvPlayer;
    public HomeController(){
        light = Light.getLight();
        popcorn = Popcorn.getPopcorn();
        tvPlayer = TVPlayer.getTvPlayer();
    }
    public void on(){
        light.on();
        popcorn.on();
        tvPlayer.on();
    }
    public void off(){
        light.off();
        popcorn.off();
        tvPlayer.off();
    }
    public void work(){
        popcorn.doPopcorn();
        tvPlayer.switchTv();
    }
}
